/*
 * @Author: Lizhenyu
 * @Date: 2021-07-23 15:01:43
 * @FilePath: \usp-osm-frondend\src\api\service.js
 */
import { service } from '@/utils/request'

const api = {
  // 服务包管理
  deletePackage: '/admin/service/package/delete',
  servicePackage: '/admin/service/package/pageList',
  servicePackageDetail: '/admin/service/package/preview',
  servicePackageEdit: '/admin/service/package/save',
  // 服务管理
  deleteService: '/admin/service/right/delete',
  serviceList: '/admin/service/right/pageList',
  serviceDetail: '/admin/service/right/preview',
  serviceEdit: '/admin/service/right/save',
  serviceProviderList: '/admin/service/right/list',
  // 服务商管理
  serviceProvider: '/admin/mdm/service/provider/pageList',
  serviceProviderDetail: '/admin/mdm/service/provider/preview',
  serviceProviderEdit: '/admin/mdm/service/provider/save',
  getEquityList: '/admin/service/customerService/list',
  freezeStatus: '/admin/service/customerService/frozen',
  getEquityDetail: '/admin/service/customerService/service_details_list',
  getUserDetail: '/admin/service/customerService/use_info_list'
}

// 服务包api
export function getServicePackage (data) {
  return service({
    url: api.servicePackage,
    method: 'post',
    data
  })
}

export function getServicePackageDetail (data) {
  return service({
    url: api.servicePackageDetail,
    method: 'post',
    data
  })
}

export function saveServicePackageEdit (data) {
  return service({
    url: api.servicePackageEdit,
    method: 'post',
    data
  })
}

export function deletePackage (data) {
  return service({
    url: api.deletePackage,
    method: 'post',
    data
  })
}

// 服务管理api
export function getServiceList (data) {
  return service({
    url: api.serviceList,
    method: 'post',
    data
  })
}

export function getServiceDetail (data) {
  return service({
    url: api.serviceDetail,
    method: 'post',
    data
  })
}

export function saveServiceEdit (data) {
  return service({
    url: api.serviceEdit,
    method: 'post',
    data
  })
}

export function getServiceProviderList (data) {
  return service({
    url: api.serviceProviderList,
    method: 'post',
    data
  })
}

export function deleteService (data) {
  return service({
    url: api.deleteService,
    method: 'post',
    data
  })
}

// 服务商api
export function getServiceProvider (data) {
  return service({
    url: api.serviceProvider,
    method: 'post',
    data
  })
}

export function getServiceProviderDetail (data) {
  return service({
    url: api.serviceProviderDetail,
    method: 'post',
    data
  })
}

export function saveServiceProviderEdit (data) {
  return service({
    url: api.serviceProviderEdit,
    method: 'post',
    data
  })
}

export function getEquityList (data) {
  return service({
    url: api.getEquityList,
    method: 'post',
    data
  })
}

export function freezeStatus (data) {
  return service({
    url: api.freezeStatus,
    method: 'post',
    data
  })
}

export function getEquityDetail (data) {
  return service({
    url: api.getEquityDetail,
    method: 'post',
    data
  })
}

export function getUserDetail (id) {
  return service({
    url: api.getUserDetail + `/${id}`,
    method: 'get'
  })
}
